/**
 * @望京、电子城、华贸服务
 * 
 * */
var url=document.URL;
var commname;
var dzc_service;
var ssqy = "HM";
var cnt;
var dataurl = "http://113.140.80.242:8090/iserver/services/data-BJPC/rest/data";
var fwurl = requestUrl();
var imgurl = getImgUrl();
var center;
var lpheading;
var range1;
var tranheight;
var Rangeheight;
var pitchcsh;
var brochureId = "";
var hsid,houseid;
commname = getParams('name');
cnt = getParams('cnt');
buildid = getParams('buildid');
hsid = getParams('hsid');
houseid = getParams('houseid');
brochureId = getParams('brochureId');

function browserRedirect() {
    var sUserAgent = navigator.userAgent.toLowerCase();
    var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
    var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
    var bIsMidp = sUserAgent.match(/midp/i) == "midp";
    var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
    var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
    var bIsAndroid = sUserAgent.match(/android/i) == "android";
    var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
    var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
    if ( bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
    	if(commname == "华贸中心"||commname == "BJCY001"){
    		serviceaddress1("BJAndroid","HMZX","hmzx");//6+12组合
    		center={x:116.47466421824433,y:39.90788091996372};
    		lpheading = 340;
    		range1 = 350;
    		tranheight = 110;
    		Rangeheight = 230;
    		pitchcsh = -5.0;
    }else if(commname == "金长安大厦"||commname == "BJCY002"){
    	serviceaddress1("BJAndroid","JCA","jca");
    	lpheading = 60;
    	range1 = 250;
    	tranheight = 80;
    	Rangeheight = 230;
    	pitchcsh = -5.0;
    	center={x:116.485425,y:39.896811};
    }else if(commname == "sk大厦"||commname == "SK大厦"||commname == "BJCY003"){
    	serviceaddress1("BJAndroid","SKDS","skds");
    	center={x:116.450701,y:39.906145};
    	lpheading = 210;
    	range1 = 300;
    	tranheight = 120;
    	Rangeheight = 230;
    	pitchcsh = -5.0;
    }else if(commname == "艾维克大厦"||commname == "BJCY004"){
    	serviceaddress1("BJAndroid","AWKDS","awkds");
    	pitchcsh = -5.0;
    	lpheading = 35;
    	range1 = 200;
    	tranheight = 90;
    	Rangeheight = 150;
    	center={x:116.456703,y:39.903801};
    }else if(commname == "合生财富大厦"||commname == "BJCY005"){
    	serviceaddress1("BJAndroid","HSCFGC","cyhecfgc");
    	lpheading = 115;
    	range1 = 150;
    	tranheight = 60;
    	Rangeheight = 90;
    	pitchcsh = -5.0;
    	center={x:116.472192,y:39.888942};
    }else if(commname == "光华路soho二期"||commname == "光华路SOHO二期"||commname == "BJCY006"){
    	serviceaddress1("BJAndroid","GHLSOHO","ghlsoho");
    	center={x:116.445971,y:39.912624};
    	lpheading = 340;
    	range1 = 250;
    	tranheight = 60;
    	Rangeheight = 200;
    	pitchcsh = -5.0;
    }else if(commname == "海航实业大厦"||commname == "BJCY007"){
    	serviceaddress1("BJAndroid","HHSYDS","hhsyds");
    	lpheading = 150;
    	center={x:116.458709,y:39.906142};
    	range1 = 220;
    	tranheight = 80;
    	Rangeheight = 180;
    	pitchcsh = -5.0;
    }else if(commname == "佳龙大厦"||commname == "BJCY008"){
    	serviceaddress1("BJAndroid","JLDS","jlds");
    	pitchcsh = -5.0;
    	lpheading = 150;
    	center={x:116.454359,y:39.891488};
    	range1 = 200;
    	tranheight = 60;
    	Rangeheight = 150;
    }else if(commname == "京汇大厦"||commname == "BJCY009"){
    	serviceaddress1("BJAndroid","JHDS","jhds");
    	center={x:116.457091,y:39.905496};
    	range1 = 250;
    	tranheight = 90;
    	Rangeheight = 200;
    	lpheading = 0;
    	pitchcsh = -5.0;
    }else if(commname == "乐成中心"||commname == "BJCY010"){
    	serviceaddress1("BJAndroid","LCZX","lczx");
    	center={x:116.456556,y:39.893103};
    	range1 = 280;
    	tranheight = 90;
    	Rangeheight = 230;
    	lpheading = 40;
    	pitchcsh = -25.0;
    }else if(commname == "招商局大厦"||commname == "BJCY011"){
    	serviceaddress1("BJAndroid","ZSJDS","zsjds");
    	center={x:116.457185,y:39.906138};
    	range1 = 300;
    	tranheight = 110;
    	lpheading = 290;
    	Rangeheight = 230;
    	pitchcsh = -5.0;
    }
    } else if(bIsIphoneOs){
    	if(commname == "华贸中心"||commname == "BJCY001"){
    		serviceaddress1("BJIOS","HMZX","hmzx");//6+12组合
    		center={x:116.47466421824433,y:39.90788091996372};
    		lpheading = 340;
    		range1 = 350;
    		tranheight = 110;
    		Rangeheight = 230;
    		pitchcsh = -5.0;
    }else if(commname == "金长安大厦"||commname == "BJCY002"){
    	serviceaddress1("BJIOS","JCA","jca");
    	pitchcsh = -5.0;
    	lpheading = 60;
    	range1 = 250;
    	tranheight = 80;
    	Rangeheight = 230;
    	center={x:116.485425,y:39.896811};
    }else if(commname == "sk大厦"||commname == "SK大厦"||commname == "BJCY003"){
    	serviceaddress1("BJIOS","SKDS","skds");
    	center={x:116.450701,y:39.906145};
    	lpheading = 210;
    	range1 = 300;
    	tranheight = 120;
    	Rangeheight = 230;
    	pitchcsh = -5.0;
    }else if(commname == "艾维克大厦"||commname == "BJCY004"){
    	serviceaddress1("BJIOS","AWKDS","awkds");
    	lpheading = 35;
    	range1 = 200;
    	tranheight = 90;
    	Rangeheight = 150;
    	pitchcsh = -5.0;
    	center={x:116.456703,y:39.903801};
    }else if(commname == "合生财富大厦"||commname == "BJCY005"){
    	serviceaddress1("BJIOS","HSCFGC","cyhecfgc");
    	lpheading = 115;
    	range1 = 150;
    	tranheight = 60;
    	Rangeheight = 90;
    	pitchcsh = -5.0;
    	center={x:116.472192,y:39.888942};
    }else if(commname == "光华路soho二期"||commname == "光华路SOHO二期"||commname == "BJCY006"){
    	serviceaddress1("BJIOS","GHLSOHO","ghlsoho");
    	center={x:116.445971,y:39.912624};
    	lpheading = 340;
    	range1 = 250;
    	tranheight = 60;
    	Rangeheight = 200;
    	pitchcsh = -5.0;
    }else if(commname == "海航实业大厦"||commname == "BJCY007"){
    	serviceaddress1("BJIOS","HHSYDS","hhsyds");
    	lpheading = 150;
    	center={x:116.458709,y:39.906142};
    	range1 = 220;
    	tranheight = 80;
    	Rangeheight = 180;
    	pitchcsh = -5.0;
    }else if(commname == "佳龙大厦"||commname == "BJCY008"){
    	serviceaddress1("BJIOS","JLDS","jlds");
    	lpheading = 150;
    	center={x:116.454359,y:39.891488};
    	range1 = 200;
    	tranheight = 60;
    	Rangeheight = 150;
    	pitchcsh = -5.0;
    }else if(commname == "京汇大厦"||commname == "BJCY009"){
    	serviceaddress1("BJIOS","JHDS","jhds");
    	center={x:116.457091,y:39.905496};
    	range1 = 250;
    	tranheight = 90;
    	Rangeheight = 200;
    	lpheading = 0;
    	pitchcsh = -5.0;
    }else if(commname == "乐成中心"||commname == "BJCY010"){
    	serviceaddress1("BJIOS","LCZX","lczx");
    	center={x:116.456556,y:39.893103};
    	range1 = 280;
    	tranheight = 90;
    	Rangeheight = 230;
    	lpheading = 40;
    	pitchcsh = -25.0;
    }else if(commname == "招商局大厦"||commname == "BJCY011"){
    	serviceaddress1("BJIOS","ZSJDS","zsjds");
    	center={x:116.457185,y:39.906138};
    	range1 = 300;
    	tranheight = 110;
    	lpheading = 290;
    	Rangeheight = 230;
    	pitchcsh = -5.0;
    }
    	
    }else if(bIsIpad){
    	if(commname == "华贸中心"||commname == "BJCY001"){
    		serviceaddress1("BJIOS","HMZX","hmzx");//6+12组合
    		center={x:116.47466421824433,y:39.90788091996372};
    		lpheading = 340;
    		range1 = 350;
    		tranheight = 110;
    		Rangeheight = 230;
    		pitchcsh = -5.0;
    }else if(commname == "金长安大厦"||commname == "BJCY002"){
    	serviceaddress1("BJIOS","JCA","jca");
    	lpheading = 60;
    	range1 = 250;
    	tranheight = 80;
    	Rangeheight = 230;
    	pitchcsh = -5.0;
    	center={x:116.485425,y:39.896811};
    }else if(commname == "sk大厦"||commname == "SK大厦"||commname == "BJCY003"){
    	serviceaddress1("BJIOS","SKDS","skds");
    	center={x:116.450701,y:39.906145};
    	lpheading = 210;
    	range1 = 300;
    	tranheight = 120;
    	Rangeheight = 230;
    	pitchcsh = -5.0;
    }else if(commname == "艾维克大厦"||commname == "BJCY004"){
    	serviceaddress1("BJIOS","AWKDS","awkds");
    	lpheading = 35;
    	range1 = 200;
    	tranheight = 90;
    	Rangeheight = 150;
    	pitchcsh = -5.0;
    	center={x:116.456703,y:39.903801};
    }else if(commname == "合生财富大厦"||commname == "BJCY005"){
    	serviceaddress1("BJIOS","HSCFGC","cyhecfgc");
    	lpheading = 115;
    	range1 = 150;
    	tranheight = 60;
    	Rangeheight = 90;
    	pitchcsh = -5.0;
    	center={x:116.472192,y:39.888942};
    }else if(commname == "光华路soho二期"||commname == "光华路SOHO二期"||commname == "BJCY006"){
    	serviceaddress1("BJIOS","GHLSOHO","ghlsoho");
    	center={x:116.445971,y:39.912624};
    	lpheading = 340;
    	range1 = 250;
    	tranheight = 60;
    	Rangeheight = 200;
    	pitchcsh = -5.0;
    }else if(commname == "海航实业大厦"||commname == "BJCY007"){
    	serviceaddress1("BJIOS","HHSYDS","hhsyds");
    	lpheading = 150;
    	center={x:116.458709,y:39.906142};
    	range1 = 220;
    	tranheight = 80;
    	Rangeheight = 180;
    	pitchcsh = -5.0;
    }else if(commname == "佳龙大厦"||commname == "BJCY008"){
    	serviceaddress1("BJIOS","JLDS","jlds");
    	lpheading = 150;
    	center={x:116.454359,y:39.891488};
    	range1 = 200;
    	tranheight = 60;
    	Rangeheight = 150;
    	pitchcsh = -5.0;
    }else if(commname == "京汇大厦"||commname == "BJCY009"){
    	serviceaddress1("BJIOS","JHDS","jhds");
    	center={x:116.457091,y:39.905496};
    	range1 = 250;
    	tranheight = 90;
    	Rangeheight = 200;
    	lpheading = 0;
    	pitchcsh = -5.0;
    }else if(commname == "乐成中心"||commname == "BJCY010"){
    	serviceaddress1("BJIOS","LCZX","lczx");
    	center={x:116.456556,y:39.893103};
    	range1 = 280;
    	tranheight = 90;
    	Rangeheight = 230;
    	lpheading = 40;
    	pitchcsh = -25.0;
    }else if(commname == "招商局大厦"||commname == "BJCY011"){
    	serviceaddress1("BJIOS","ZSJDS","zsjds");
    	center={x:116.457185,y:39.906138};
    	range1 = 300;
    	tranheight = 110;
    	lpheading = 290;
    	Rangeheight = 230;
    	pitchcsh = -5.0;
    }
    	
    }else{
    	if(commname == "华贸中心"||commname == "BJCY001"){
    		serviceaddress1("BJAndroid","HMZX","hmzx");//6+12组合
    		center={x:116.47466421824433,y:39.90788091996372};
    		lpheading = 340;
    		range1 = 350;
    		tranheight = 110;
    		Rangeheight = 230;
    		pitchcsh = -5.0;
    }else if(commname == "金长安大厦"||commname == "BJCY002"){
    	serviceaddress1("BJAndroid","JCA","jca");
    	lpheading = 60;
    	range1 = 250;
    	tranheight = 80;
    	Rangeheight = 230;
    	pitchcsh = -5.0;
    	center={x:116.485425,y:39.896811};
    }else if(commname == "sk大厦"||commname == "SK大厦"||commname == "BJCY003"){
    	serviceaddress1("BJAndroid","SKDS","skds");
    	center={x:116.450701,y:39.906145};
    	lpheading = 210;
    	range1 = 300;
    	tranheight = 120;
    	Rangeheight = 230;
    	pitchcsh = -5.0;
    }else if(commname == "艾维克大厦"||commname == "BJCY004"){
    	serviceaddress1("BJAndroid","AWKDS","awkds");
    	lpheading = 35;
    	range1 = 200;
    	tranheight = 90;
    	Rangeheight = 150;
    	pitchcsh = -5.0;
    	center={x:116.456703,y:39.903801};
    }else if(commname == "合生财富大厦"||commname == "BJCY005"){
    	serviceaddress1("BJAndroid","HSCFGC","cyhecfgc");
    	lpheading = 115;
    	range1 = 150;
    	tranheight = 60;
    	Rangeheight = 90;
    	pitchcsh = -5.0;
    	center={x:116.472192,y:39.888942};
    }else if(commname == "光华路soho二期"||commname == "光华路SOHO二期"||commname == "BJCY006"){
    	serviceaddress1("BJAndroid","GHLSOHO","ghlsoho");
    	center={x:116.445971,y:39.912624};
    	lpheading = 340;
    	range1 = 250;
    	tranheight = 60;
    	Rangeheight = 200;
    	pitchcsh = -5.0;
    }else if(commname == "海航实业大厦"||commname == "BJCY007"){
    	serviceaddress1("BJAndroid","HHSYDS","hhsyds");
    	lpheading = 150;
    	center={x:116.458709,y:39.906142};
    	range1 = 220;
    	tranheight = 80;
    	Rangeheight = 180;
    	pitchcsh = -5.0;
    }else if(commname == "佳龙大厦"||commname == "BJCY008"){
    	serviceaddress1("BJAndroid","JLDS","jlds");
    	lpheading = 150;
    	center={x:116.454359,y:39.891488};
    	range1 = 200;
    	tranheight = 60;
    	Rangeheight = 150;
    	pitchcsh = -5.0;
    }else if(commname == "京汇大厦"||commname == "BJCY009"){
    	serviceaddress1("BJAndroid","JHDS","jhds");
    	center={x:116.457091,y:39.905496};
    	range1 = 250;
    	tranheight = 90;
    	Rangeheight = 200;
    	lpheading = 0;
    	pitchcsh = -5.0;
    }else if(commname == "乐成中心"||commname == "BJCY010"){
    	serviceaddress1("BJAndroid","LCZX","lczx");
    	center={x:116.456556,y:39.893103};
    	range1 = 280;
    	tranheight = 90;
    	Rangeheight = 230;
    	lpheading = 40;
    	pitchcsh = -25.0;
    }else if(commname == "招商局大厦"||commname == "BJCY011"){
    	serviceaddress1("BJAndroid","ZSJDS","zsjds");
    	center={x:116.457185,y:39.906138};
    	range1 = 300;
    	tranheight = 110;
    	lpheading = 290;
    	Rangeheight = 230;
    	pitchcsh = -5.0;
    }
    }
    
}
browserRedirect(); 



function serviceaddress1(servicename,name,domname){
	dzc_service={
			service:{//http://113.140.80.242:8090/iserver/services/3D-HM2/rest
				sceneAddress:"http://113.140.80.242:8090/iserver/services/3D-"+servicename+"/rest/realspace",//rest服务地址
				serverurl:"http://113.140.80.242:8090/iserver/services/data-BJPC/rest/data",//数据服务地址
				serverurlsys:"http://113.140.80.242:8090/iserver/services/spatialAnalysis-BJPC/restjsr/spatialanalyst",
				name:"HM"
			},
			serverurllayers : {
				Model : {
					'HM' : 'http://113.140.80.242:8090/iserver/services/3D-'+servicename+'/rest/realspace/datas/建筑6调色@'+name+'/config',
					'HM12':'http://113.140.80.242:8090/iserver/services/3D-'+servicename+'/rest/realspace/datas/建筑12调色@'+name+'/config',
					'LCZX':'http://113.140.80.242:8090/iserver/services/3D-'+servicename+'/rest/realspace/datas/lczx12@beijing20190426_9D/config'
				},
				Dom : {
					'HM' : 'http://113.140.80.242:8090/iserver/services/3D-'+servicename+'/rest/realspace/datas/'+domname+'@'+name
					
				},
				imageWhiteBase : 'http://113.140.80.242:8090/iserver/services/3D-'+servicename+'/rest/realspace/datas/WhiteBase@BaseData',//
				terrain : 'http://113.140.80.242:8090/iserver/services/3D-'+servicename+'/rest/realspace/datas/%E5%8C%97%E4%BA%AC%E6%9C%9D%E9%98%B3_DEM@beijing20190426_9D',
				Household:'http://113.140.80.242:8090/iserver/services/3D-'+servicename+'/rest/realspace/datas/Household@AttachData/config', //户
				floor :"http://113.140.80.242:8090/iserver/services/3D-HM2/rest/realspace/datas/Floor@AttachData/config"
			},
			layers:{
				Model : {
					'DZC' : 'Mod_DZC@20190404北京_WGS84',//DZC纹理模型
					'HM' : 'JZ6@20190412北京_WGS84',//HM纹理模型
					//'HM' : 'Model_HM@ModelData',//HM纹理模型
					'HM1' : 'Model_HM@ModelData',//HM纹理模型
					'WJ' : 'Mod_WJ@20190404北京_WGS84'//WJ纹理模型
				},
				Build : {
					'DZC' : 'Build_DZC@WhiteData',//DZC白模图层
					'HM' : 'Build_HM@WhiteData',//HM白模图层
					'WJ' : 'Build_WJ@WhiteData'//WJ白模图层
				},
				Dom : {
					
					'HM' : 'DOM_hm@BaseData',//hmDOM图层
				
				},
					layerhousehold:"Household@AttachData",//户图层
					layercommitry:"Community@AttachData",//小区图层
					layerunderside:"Underside@AttachData",//underside图层
					layerBase:"WhiteBase@BaseData"
			},
			datalayers:{
				Model : {
					'DZC' : 'ModelData:Mod_DZC',//DZC纹理模型
					//'HM' : 'ModelData:Mod_HM',//HM纹理模型
					'HM' : '20190412北京_WGS84:JZ6',//HM纹理模型
					'HM1' : 'ModelData:Model_HM',//HM纹理模型
					'WJ' : 'ModelData:Mod_WJ'//WJ纹理模型
				},
				Build : {
					'DZC' : 'WhiteData:Build_DZC',//DZC白模图层
					'HM' : 'WhiteData:Build_HM',//HM白模图层
					'WJ' : 'WhiteData:Build_WJ'//WJ白模图层
				},
				layerhousehold:"AttachData:Household",//户图层
				layercommitry:"AttachData:Community",//小区图层
				layerunderside:"AttachData:Underside"//underside图层
			}
	}
}

